package com.capsulode.excel.exception;

import java.util.ArrayList;
import java.util.Collection;

/**
 * 封装表格行处理失败信息.
 */
public class RowFailure {
    private final int index;
    private final Collection<String> raw;
    private final Collection<CellFailure> failures = new ArrayList<>();

    public RowFailure(int index, Collection<String> raw) {
        this.index = index + 1;
        this.raw = raw;
    }

    public void addFailure(CellFailure failure) {
        failures.add(failure);
    }

    public int getIndex() {
        return index;
    }

    public Collection<String> getRaw() {
        return raw;
    }

    public Collection<CellFailure> getFailures() {
        return failures;
    }
}
